package com.whmnx.shop.ui.viewmodel;

import android.app.Application;
import android.widget.RadioGroup;

import androidx.annotation.NonNull;

import com.whmnx.shop.databinding.FragmentCommentBinding;
import com.whmnx.shop.ui.fragment.CommentFragment;

import me.goldze.mvvmhabit.base.BaseViewModel;

/**
 * author : huang
 * date   : 2020/10/21 0021 19:33
 * version: 1.0
 * @author Administrator
 */
public class CommentModel extends BaseViewModel {

     public CommentFragment mFragment;
     public FragmentCommentBinding mBinding;

    public CommentModel(@NonNull Application application) {
        super(application);
    }

    public void initToolbar(CommentFragment commentFragment, FragmentCommentBinding binding) {
        this.mFragment = commentFragment;
        this.mBinding = binding;
        mBinding.rbMainHome.setChecked(true);
        initView();
    }

    private void initView() {
        mBinding.rgContent.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(RadioGroup group, int checkedId) {
                int position = group.indexOfChild(group.findViewById(checkedId));
                switch (position) {
                    case 0:

                        break;
                    case 1:

                        break;
                    case 2:

                        break;
                    case 3:

                        break;
                    case 4:

                        break;
                    default:
                }
            }
        });
    }


}
